<ul class="list recepti">
	<? foreach($receipes as $receipe): ?>
	<?
		$material = array();
		foreach($receipe['ReceipeMaterial'] as $m) {
			$material[] = '<span class="name">' . $m['name'] . '</span>';
		}
		
		$max_material = 5;
		if(count($material)>$max_material) {
			$material = array_slice($material, 0, $max_material);
			$material[] = "...";
		}
	?>
	<li>
		<?= $this->Html->link(
			'<span class="image">' . $this->Html->image('recepti/' . $receipe['Receipe']['image'] . "?h=80") . '</span>' . 
			'<span class="material"><span class="title">' . $receipe['Receipe']['title'] . '</span>' . implode("<br>", $material) . '</span>',
			'/recepti/recept/' . $receipe['Receipe']['id'] . '/' . Inflector::slug($receipe['Receipe']['title'], "-"),
			array(
				'escape' => false
			)
		)
		?>
	</li>
	<? endforeach; ?>
</ul>